package top.fyxxxx.downloader.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/***
 * DbHelper类
 * 用于初始化数据库和表单
 * 并提供数据库连接
 */
public class DbHelper extends SQLiteOpenHelper {
    public static final String CREATE_History = "create table history (" +
            "date INTEGER , filename TEXT primary key,filepath TEXT,url TEXT, filesize INTEGER,downloadedsize INTEGER,status INTEGER)";
    public static final String CREATE_Tree = "create table tree (" +
            "son TEXT primary key, father TEXT)";


    public DbHelper(Context context) {
        super(context, "mydbaa", null ,1);
    }
    
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_History);
        db.execSQL(CREATE_Tree);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
